package com.example.Controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.Service.InterviewServie;
import com.example.Service.impl.InterviewServiceImpl;
import com.example.dao.InterviewMapper;
import com.example.pojo.Interview;
import com.example.util.Result;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;

@Api(tags = "面试管理")
@CrossOrigin
@RestController
public class InterviewController {

    @Autowired
    private InterviewServiceImpl interviewServie;


    @RequestMapping("selectInter")  //查询面试信息
    public Result selectInter(@RequestBody Interview interview) {

         List<Interview> interviews = interviewServie.selectAll(interview.getInterviewStatus());
        // 返回结果
        if (!interviews.isEmpty()) {
            return new Result("200", "查询成功", interviews);
        } else {
            return new Result("444", "查询失败");
        }
    }

    @RequestMapping("/selectStatus")  //插图查询状态
    public Result selectStatus() {
        List<Interview> interviews = interviewServie.selectStatus();
        return  new Result("200", "查询成功", interviews);
    }
}
